python get output of command to variable

42

python get output of command to variable -

import subprocess as sp
output = sp.getoutput('whoami --version')
print (output)

Comments

Submit
0 Comments